package com.im;

import java.util.ArrayList;

public class DotCom {
	private ArrayList<String> locationCells;
	private String name;
	
	public void setName(String str) {
		name = str;
	}

	public void setLocationCells(ArrayList<String> newLocation) {
		locationCells = newLocation;
	}

	public String checkYourself(String userGuess) {
		String status = "miss";
		int index = locationCells.indexOf(userGuess);
		if (index >= 0) {
			locationCells.remove(index);
			if (locationCells.isEmpty()) {
				status = "kill";
				System.out.println("Ouch! You sunk " + name + "  : (");
			} else {
				status = "hit!";
			}
		}
		return status;
	}
}
